import localforage from 'localforage'
import { APP_PREFIX } from "../config"

const USER_KEY = APP_PREFIX + 'user'

const PRODUCTION_LINE_KEY = APP_PREFIX + 'productionLines'

const WAREHOUSE_LINE_KEY = APP_PREFIX + 'WarehouseIds'

export const getUser = () => {
  return localforage.getItem(USER_KEY)
}

export const setUser = (val) => {
  return localforage.setItem(USER_KEY, val)
}

export const removeUser = () => {
  return localforage.removeItem(USER_KEY)
}

export const setProductionLines = (val) => {
  return localforage.setItem(PRODUCTION_LINE_KEY, val)
}

export const getProductionLines = () => {
  return localforage.getItem(PRODUCTION_LINE_KEY)
}

export const setWarehouseIds = (val) => {
  return localforage.setItem(WAREHOUSE_LINE_KEY, val)
}

export const getWarehouseIds = () => {
  return localforage.getItem(WAREHOUSE_LINE_KEY)
}